﻿<navigation:Page x:Class="AppLab.Views.Task" 
           xmlns:local="clr-namespace:AppLab"
           xmlns:web="clr-namespace:AppLab.Web"
           xmlns:control="clr-namespace:AppLab.Controls"
           xmlns:Views="clr-namespace:AppLab.Views"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           d:DataContext="{d:DesignInstance Type=web:TaskSubmitData}"      
           Style="{StaticResource PageStyle}" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <local:DateTimeConverter x:Key="DateConverter"></local:DateTimeConverter>
            <local:BooleanToVisibilityConverter x:Key="VisibleConverter"/>
            <local:NullItemToEntity x:Key="NullItemToEntity"></local:NullItemToEntity>
        </Grid.Resources>

        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}" >
            <toolkit:BusyIndicator x:Name="busyIndicatorLoad" Grid.RowSpan="2"  BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorLoad, Source={StaticResource ResourceWrapper}}">
                <toolkit:BusyIndicator x:Name="busyIndicator" BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorRegisteringUser, Source={StaticResource ResourceWrapper}}"
                             IsBusy="{Binding IsBusy}">
                    <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">

                        <!--<TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
                           Text="{Binding Path=ApplicationStrings.TaskPageTitle, Source={StaticResource ResourceWrapper}}"/>-->

                        <StackPanel Orientation="Horizontal" Margin="10">
                            <!--<TextBlock Text="{Binding Path=ApplicationStrings.SelectedMobileBrandOnTerminalInfo, Source={StaticResource ResourceWrapper}}" 
                                     Style="{StaticResource ContentTextStyle}"/>
                            <ComboBox Name="mobileBrand" Height="23" Width="100" SelectionChanged="mobileBrand_SelectionChanged" />-->
                            <TextBlock Text="{Binding Path=ApplicationStrings.InputMobileTypeOnTerminalInfo, Source={StaticResource ResourceWrapper}}" 
                                     Style="{StaticResource ContentTextStyle}"  />
                            <sdk:AutoCompleteBox Name="autoCompleteBoxMbBrand" Height="23" IsTextCompletionEnabled="True" HorizontalAlignment="Left" 
                                             Width="120" VerticalAlignment="Top" IsDropDownOpen="True" TabNavigation="Cycle"/>
                            <Button Name="SearchButton" Content="{Binding Path=ApplicationStrings.SearchButtonOnTerminalInfo, Source={StaticResource ResourceWrapper}}"
                                       Height="23" Click="SearchButton_Click" />
                            <!--<TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}"  VerticalAlignment="Center"  Margin="25,0,0,0" HorizontalAlignment="Left"
                           Text="请提交客户端验收报告"/>-->
                        </StackPanel>
                        <sdk:DataGrid AutoGenerateColumns="False" Name="dataGridTableList" Height="200" IsReadOnly="True" 
                                  GridLinesVisibility="Vertical" HorizontalAlignment="Left" BorderThickness="2" 
                                  BorderBrush="#FFCE6A6A" ColumnWidth="100" Margin="20,0,0,0" 
                                  SelectionChanged="dataGridTableList_SelectionChanged" SelectionMode="Single">
                            <sdk:DataGrid.Columns>
                                <sdk:DataGridTextColumn Header="品牌" Binding="{Binding MobileBrand}" />
                                <sdk:DataGridTextColumn Header="型号" Binding="{Binding MobileType}" />
                                <sdk:DataGridTextColumn Header="版本" Binding="{Binding MobileVersion}" />
                                <sdk:DataGridTextColumn Header="提交人" Binding="{Binding SubmitBy}" />
                                <sdk:DataGridTextColumn Header="提交时间" Width="120" Binding="{Binding SubmitTime, StringFormat=yyyy-MM-dd HH:mm}" />
                                <sdk:DataGridTextColumn Header="提交类型" Width="110" Binding="{Binding SubmitType}" />
                                <sdk:DataGridTextColumn Header="审核人" Binding="{Binding ReviewBy}" />
                                <sdk:DataGridTextColumn Header="审核时间" Width="120" Binding="{Binding StartTime, StringFormat=yyyy-MM-dd HH:mm}"/>
                                <sdk:DataGridTextColumn Header="优先级" Width="60" Binding="{Binding Priority}"/>
                                <sdk:DataGridTextColumn Header="指定验收人" Width="120" Binding="{Binding AssignedTo}"/>
                                <sdk:DataGridTextColumn Header="指定验收完成时间" Width="120" Binding="{Binding TestTaskEAT, StringFormat=yyyy-MM-dd}"/>
                            </sdk:DataGrid.Columns>
                        </sdk:DataGrid>
                        <Grid>
                            <sdk:DataPager Name="dpTaskInfo" VerticalAlignment="Top" IsTotalItemCountFixed="True" HorizontalAlignment="Left"  Source="{Binding ItemsSource, ElementName=dataGridTableList}" Margin="20,0,0,0" Grid.Row="1">
                            </sdk:DataPager>
                        </Grid>

                        <TextBlock Name="TipsForAdaptation" Height="20" VerticalAlignment="Center" Margin="20,20,0,0" FontSize="14" Foreground="Blue"></TextBlock>

                        <Grid  Name="detailInfo" Visibility="{Binding ElementName=detailInfo,Path=IsHitTestVisible,Converter={StaticResource VisibleConverter}}">
                            <control:ReviewCustomDataForm x:Name="taskForm" CurrentItem="{Binding ElementName=dataGridTableList, Path=SelectedItem, Converter={StaticResource NullItemToEntity}}" AutoEdit="True" CommandButtonsVisibility="None" Style="{StaticResource DataFormStyle}" HorizontalAlignment="Left" Margin="0,10,0,0" />

                            <Grid Margin="390,10,0,0">
                                <TextBlock Name="TipsForWrongInfo" VerticalAlignment="Top" FontSize="14" Foreground="Red"></TextBlock>

                                <RadioButton Content="验收通过"  HorizontalAlignment="Left" Margin="0,30,0,0" Name="rdoAccept" VerticalAlignment="Top" IsChecked="True"/>
                                <RadioButton Content="验收未通过"  HorizontalAlignment="Left" Margin="100,30,0,0" Name="rdoReject" VerticalAlignment="Top"/>
                                <RadioButton Content="保留意见"  HorizontalAlignment="Left" Margin="200,30,0,0" Name="rdoHold" VerticalAlignment="Top"/>
                                <TextBlock Height="30" HorizontalAlignment="Left" Name="tbUploadTestReport" Text="上传验收报告:" Width="80" VerticalAlignment="Top" Margin="0,60,0,0"></TextBlock>
                                <control:UploadTaskReport x:Name="tbTestReport"  Height="25" HorizontalAlignment="Left" Width="200" Margin="6,90,80,0" VerticalAlignment="Top" KeyDown="tbTestReport_KeyDown" TextChanged="tbTestReport_TextChanged" />
                                <TextBlock HorizontalAlignment="Left" Text="{Binding Path=ApplicationStrings.FriendlyshipTipsOnTask, Source={StaticResource ResourceWrapper}}"
                                           VerticalAlignment="Top" Margin="210,98,0,0" FontSize="11" Foreground="Blue"></TextBlock>

                                <!--<TextBlock Height="30" HorizontalAlignment="Left" Name="tbLeadOnly" Text="(Lead Only):重新分配:" Width="120" VerticalAlignment="Top" Margin="0,60,0,0"></TextBlock>
                            <ComboBox Height="25" HorizontalAlignment="Left" Margin="120,60,0,0" Name="cmbTesters" VerticalAlignment="Top" Width="100"/>-->
                                <!--<Button Content="重置" Name="buttonReset" Width="60"  Margin="0,100,0,0" Height="27" VerticalAlignment="Top" HorizontalAlignment="Left" Click="buttonReset_Click" />-->
                                <Button Content="提交" Name="buttonSubmit" Width="60"  Margin="6,125,0,0" Height="27" VerticalAlignment="Top" HorizontalAlignment="Left" Click="buttonSubmit_Click" />

                            </Grid>

                        </Grid>

                    </StackPanel>
                </toolkit:BusyIndicator>
            </toolkit:BusyIndicator>
        </ScrollViewer>
    </Grid>
</navigation:Page>

